package com.yao.fin.enums;

import lombok.Getter;

import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @author yaoyuming
 * @date 2020/03/13 15:32
 */
@Getter
public enum SingleEnum {
    SINGLE(1, "单选"),
    NULIT(2, "多选");

    private final int code;
    private final String desc;

    SingleEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private static Map<Integer, String> enums = Stream.of(SingleEnum.values()).collect(Collectors.toMap(SingleEnum::getCode, SingleEnum::getDesc));

    public static String getDesc(int code){
        return enums.get(code);
    }
}
